package com.xxc.exam.config

import com.xxc.exam.interceptor.CorsInterceptor
import com.xxc.batis.qo.PageQO
import org.mybatis.spring.boot.autoconfigure.MybatisAutoConfiguration
import org.springframework.beans.factory.annotation.Autowired
import org.springframework.beans.factory.annotation.Value
import org.springframework.boot.autoconfigure.AutoConfigureAfter
import org.springframework.context.annotation.Bean
import org.springframework.context.annotation.Configuration
import org.springframework.web.servlet.config.annotation.InterceptorRegistry
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer


@Configuration
@AutoConfigureAfter(MybatisAutoConfiguration::class)
class WebMvcConfig:WebMvcConfigurer {
    @Autowired
    lateinit var corsInterceptor:CorsInterceptor



    override fun addInterceptors(registry: InterceptorRegistry) {
        super.addInterceptors(registry)
        registry.addInterceptor(corsInterceptor)
    }

//    override fun addArgumentResolvers(resolvers: MutableList<HandlerMethodArgumentResolver>) {
//        super.addArgumentResolvers(resolvers)
//        resolvers.add(userResolver)
//    }


}